import api from "./api";
import type Typings from "@/typings";

export default {
  roleListApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/role/list";
    return api.post(url, data, { ...config });
  },

  roleAddApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/role/add";
    return api.post(url, data, { ...config, openLoading: true });
  },

  roleUpdateApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/role/update";
    return api.post(url, data, { ...config, openLoading: true });
  },

  roleCheckApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/role/check";
    return api.get(url, data, { ...config });
  },

  roleRemoveApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/role/remove";
    return api.get(url, data, { ...config });
  },
};
